package com.dhcc.bpm.modules.log.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dhcc.bpm.modules.log.entity.GatewayLogDay;
import com.dhcc.bpm.modules.log.vo.*;

import java.util.List;


/**
 * @ClassName GatewayLogDayMapper.class
 * @Description   消网关访问记录日表 Mapper 接口
 * @Author xiaFaYu
 * @Date 2019-12-16 14:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
public interface GatewayLogDayMapper extends BaseMapper<GatewayLogDay> {

	/**
	 * @Description 自定义分页
	 * @Author xiafayu
	 * @Date 2020/2/24 15:27
	 * @param page
	 * @param gatewayLogDay
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.GatewayLogDayVO>
	 **/
	List<GatewayLogDayVO> selectGatewayLogDayPage(IPage page, GatewayLogDayVO gatewayLogDay);


	/**
	 * @Description 查询数量
	 * @Author xiafayu
	 * @Date 2020/2/24 15:28
	 * @param apiRank
	 * @return java.lang.Integer
	 **/
	Long countLastDayApiNum(ApiRankVo apiRank);

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:28
	 * @param gatewayLogDay
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.TradeTrendsVo>
	 **/
	List<TradeTrendsVo> countNumBydate(GatewayLogDayVO gatewayLogDay);

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:28
	 * @param gatewayLogDay
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.TradeTrendsVo>
	 **/
	List<TradeTrendsVo> countNumByYear(GatewayLogDayVO gatewayLogDay);

	/**
	 * @Description 查询某一api 按天统计数据
	 * @Author xiafayu
	 * @Date 2020/2/24 15:28
	 * @param api
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
    List<AppApiViewVo> countApiData(AppApiViewVo api);

	/**
	 * @Description 查询某一产品 按天统计数据
	 * @Author xiafayu
	 * @Date 2020/2/24 15:29
	 * @param api
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.ProductRankVo>
	 **/
	List<ProductRankVo> countProductByDate(ProductRankVo api);

	/**
	 * @Description 统计某一应用数据
	 * @Author xiafayu
	 * @Date 2020/2/24 15:29
	 * @param app
	 * @return com.dhcc.bpm.modules.log.vo.AppApiViewVo
	 **/
    AppApiViewVo countAppData(AppApiViewVo app);

	/**
	 * @Description 统计某一接口数据
	 * @Author xiafayu
	 * @Date 2020/2/24 15:29
	 * @param api
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
	List<AppApiViewVo> apiChartData(AppApiViewVo api);

	/**
	 * @Description 某一应用通过日期分组数据统计
	 * @Author xiafayu
	 * @Date 2020/2/24 15:29
	 * @param app
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
    List<AppApiViewVo> countAppDataByDate(AppApiViewVo app);

	/**
	 * @Description 总交易量--热门api排名
	 * @Author xiafayu
	 * @Date 2020/2/24 15:29
	 * @param page
	 * @param apiRank
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.ApiRankVo>
	 **/
	IPage<ApiRankVo> countApiNum(IPage<ApiRankVo> page, ApiRankVo apiRank);

	/**
	 * @Description 总交易量--应用排名
	 * @Author xiafayu
	 * @Date 2020/2/24 15:29
	 * @param page
	 * @param appRank
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.AppRankVo>
	 **/
	IPage<AppRankVo> countAppNum(IPage<AppRankVo> page, AppRankVo appRank);

	/**
	 * @Description 总交易量--产品排名
	 * @Author xiafayu
	 * @Date 2020/2/24 15:30
	 * @param page
	 * @param apiRank
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.ProductRankVo>
	 **/
	IPage<ProductRankVo> countProductNum(IPage<ProductRankVo> page, ProductRankVo apiRank);

	/**
	 * @Description 总交易量--收费排名
	 * @Author xiafayu
	 * @Date 2020/2/24 15:30
	 * @param page
	 * @param apiRank
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.ApiRankVo>
	 **/
	IPage<ApiRankVo> countCostApiNum(IPage<ApiRankVo> page, ApiRankVo apiRank);

	/**
	 * @Description 总交易量--机构排名
	 * @Author xiafayu
	 * @Date 2020/2/24 15:30
	 * @param page
	 * @param apiRank
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.OrgaRankVo>
	 **/
	IPage<OrgaRankVo> countOrgaNum(IPage<OrgaRankVo> page, OrgaRankVo apiRank);

	/**
	 * @Description 日交易量 、日成功率、日成功数（首页2，3块长方块）
	 * @Author xiafayu
	 * @Date 2020/2/24 15:30
	 * @param req
	 * @return com.dhcc.bpm.modules.log.vo.TradeVolumnVo
	 **/
    TradeVolumnVo tradingVolume(TradeVolumnVo req);

	/**
	 * @Description 日期查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:30
	 * @param gatewayLogDayVO
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.TradeAppVo>
	 **/
	List<TradeAppVo> selectCountByDate(GatewayLogDayVO gatewayLogDayVO);

	/**
	 * @Description 年份统计
	 * @Author xiafayu
	 * @Date 2020/2/24 15:31
	 * @param gatewayLogDayVO
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.TradeAppVo>
	 **/
	List<TradeAppVo> selectCountByYear(GatewayLogDayVO gatewayLogDayVO);

	/**
	 * @Description 某一api数据统计
	 * @Author xiafayu
	 * @Date 2020/2/24 15:31
	 * @param appApiViewVo
	 * @return com.dhcc.bpm.modules.log.vo.AppApiViewVo
	 **/
	AppApiViewVo apiCount(AppApiViewVo appApiViewVo);

	AppApiViewVo getCountBySysId(Long sysId);
	/**
	 * @Description 某一应用下api 数据统计
	 * @Author xiafayu
	 * @Date 2020/2/24 15:31
	 * @param page
	 * @param app
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
    IPage<AppApiViewVo> selectAppApiNum(IPage<Object> page, AppApiViewVo app);

	/**
	 * @Description 某一产品下api集合统计
	 * @Author xiafayu
	 * @Date 2020/2/24 15:33
	 * @param page
	 * @param app
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
	IPage<AppApiViewVo> selectProApiNum(IPage<Object> page, AppApiViewVo app);
	/**
	 * @Description 某一产品下api集合统计
	 * @Author xiafayu
	 * @Date 2020/2/24 15:33
	 * @param page
	 * @param app
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
	IPage<AppApiViewVo> selectProApiNumHour(IPage<Object> page, AppApiViewVo app);


	/**
	 * @Description 查询tps
	 * @Author sunhaobo
	 * @param apiRank
	 * @return
	 */
	Double countTps(ApiRankVo apiRank);
}
